package cn.shengongying.exception;

import cn.shengongying.enums.ResponseCodeEnum;

/**
 * author: RXK
 * date: 2022/1/6 星期四
 * desc:
 */
public class ParamException extends RuntimeException{

    private static final long serialVersionUID = -2134126464732765689L;

    private Integer code;

    public ParamException(Integer code,String msg) {
        super(msg);
        this.code = code;
    }


    public ParamException() {
        super(ResponseCodeEnum.param_exception.getMsg());
        this.code = ResponseCodeEnum.param_exception.getCode();
    }

    public ParamException(ResponseCodeEnum responseCodeEnum) {
        super(responseCodeEnum.getMsg());
        this.code = responseCodeEnum.getCode();
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
